// 导入axios
import instance from '@/http/index.js'

// 获取用户信息接口
export const getUserInfor = id => {
    return instance({
        url: '/user/getUserInfo',
        method: 'POST',
        data: { id }
    })
}
// 修改姓名
export const changeName = (name, id) => {
    return instance({
        url: '/user/changeName',
        method: 'POST',
        data: { name, id }
    })
}
// 修改性别
export const changeSex = (sex, id) => {
    return instance({
        url: '/user/changeSex',
        method: 'POST',
        data: { sex, id }
    })
}
// 修改邮箱
export const changeEmail = (email, id) => {
    return instance({
        url: '/user/changeEmail',
        method: 'POST',
        data: { email, id }
    })
}
// 修改密码
export const changePassword = (oldPassword, newPassword, id) => {
    return instance({
        url: '/user/changePassword',
        method: 'POST',
        data: { oldPassword, newPassword, id }
    })
}
// 上传头像
// export const uploadAvatar = (onlyId, url) => {
//     return instance({
//         url: '/user/uploadAvatar',
//         method: 'POST',
//         data: { onlyId, url }
//     })
// }
// 绑定头像与账号
export const bindAccount = (account, onlyId, url) => {
    return instance({
        url: '/user/bindAccount',
        method: 'POST',
        data: { account, onlyId, url }
    })
}